var read_line = require('readline-sync')
read_line.setDefaultOptions({ prompt: '' })
var read_line = read_line.prompt
let n = parseInt(read_line()) // 读出这个整数
if (n === 1) {
  console.log(1)
} else if (n === 2) {
  console.log(1)
} else if (n === 3) {
  console.log(1)
} else if (n === 4) {
  console.log(4)
} else if (n === 5) {
  console.log(7)
} else if (n === 6) {
  console.log(13)
} else {
  let left = 4
  let mid = 7
  let right = 13
  for (let i = 6; i < n; i++) {
    let temp = left + mid + right + 1
    left = mid
    mid = right
    right = temp
  }
  console.log(right)
}